home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / Graphic Elements 3 / LibHdrs / Sensors.h < prev   
Text File  |  1994-01-06  |  2KB  |  77 lines

  1. /*
  2.     Sensors.h
  3.     
  4.     Basic Graphic Elements which interact with the user. Version 3.
  5.     
  6.     Copyright 1993 by Al Evans. All rights reserved.
  7.     
  8.     12/8/93
  9. */
  10.  
  11. #ifndef GESENSORS
  12. #define GESENSORS
  13.  
  14. #include "GraphElements.h"
  15.  
  16. //Sensor types
  17. enum {
  18.     btnSensor,
  19.     switchSensor,
  20.     hSlideSensor,
  21.     vSlideSensor
  22. };
  23.  
  24. //Sensor states
  25. enum {
  26.     sensorOff = 0,
  27.     sensorOn
  28. };
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33.  
  34. //-------------------------------------------------------------------------------------
  35. //Pushbutton-type sensor
  36. //-------------------------------------------------------------------------------------
  37.  
  38. GrafElPtr NewButtonSensor(GEWorldPtr world, OSType id, short plane, 
  39.                     short resNum, short xPos, short yPos);
  40.  
  41. //Tracking proc for button-type sensor
  42. pascal Boolean TrackButtonSensor(GEWorldPtr world, GrafElPtr sensor);
  43.  
  44. //-------------------------------------------------------------------------------------
  45. //Switch-type sensor
  46. //-------------------------------------------------------------------------------------
  47.  
  48. GrafElPtr NewSwitchSensor(GEWorldPtr world, OSType id, short plane, 
  49.                     short resNum, short xPos, short yPos);
  50.                     
  51. //Tracking proc for switch-type sensor
  52. pascal Boolean TrackSwitchSensor(GEWorldPtr world, GrafElPtr sensor);
  53.  
  54. //Set switch to "on" or "off"
  55. pascal void SetSwitchState(GEWorldPtr world, OSType id, short newState);
  56.  
  57. //-------------------------------------------------------------------------------------
  58. //Slider-type sensor
  59. //-------------------------------------------------------------------------------------
  60.  
  61. GrafElPtr NewSliderSensor(GEWorldPtr world, OSType id, short plane,
  62.                     short resNum, short xPos, short yPos, short sliderType,
  63.                     short handleResNum);
  64.  
  65. //Tracking proc for slider-type sensor
  66. pascal Boolean TrackSliderSensor(GEWorldPtr world, GrafElPtr sensor);
  67.  
  68. //Set reading of slider-type sensor
  69. pascal void SetSliderPercent(GEWorldPtr world, OSType id, short newSetting);
  70.  
  71.  
  72. #ifdef __cplusplus
  73. }
  74. #endif
  75.  
  76.  
  77. #endif